package com.yuyang.wifi.floatView;

import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.ImageView;

import com.yuyang.wifi.R;

import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;

public class FloatView extends FloatRootView {

    private ImageView ivCover;

    public FloatView(@NonNull Context context) {
        super(context, null);
        inflate(context, R.layout.view_floating, this);
        ivCover = findViewById(R.id.iv_cover);
    }

    public void setIconImage(@DrawableRes int resId) {
        ivCover.setImageResource(resId);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        super.onTouchEvent(event);
        if (event != null) {
            switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                    Log.e("TAG", "onClick: ====ACTION_DOWN");
                    break;
                case MotionEvent.ACTION_UP:
                    Log.e("TAG", "onClick: ====ACTION_UP");
                    break;
            }
        }
        return true;
    }

}
